from __future__ import annotations

from dataclasses import dataclass


@dataclass
class InvertedLifting:
    required_lifting_kN: float
    max_unbalance_kN: float
    note: str


def compute_inverted_lifting(panel_mass_kN: float, num_jacks: int, friction_coeff: float = 0.05, sync_allowance_percent: float = 5.0) -> InvertedLifting:
    """倒装提升：总顶升力=重量×(1+摩擦)；每台千斤顶分担，并给出不同步容许偏差。"""

    total = panel_mass_kN * (1.0 + friction_coeff)
    per = total / max(1, num_jacks)
    unbalance = per * (sync_allowance_percent / 100.0)
    return InvertedLifting(required_lifting_kN=per, max_unbalance_kN=unbalance, note="需同步控制与结构稳定复核")


